# coding=utf-8
import re

s = "This is mytel:133-1234-1234"
print('----------贪婪模式---------')
pattern = r"(.+)(\d+-\d+-\d+)"
result = re.match(pattern, s)
print(result.group())
print("第一个分组匹配结果：", result.group(1))
print("第二个分组匹配结果：", result.group(2))
print('----------非贪婪模式---------')
pattern = r"(.+?)(\d+-\d+-\d+)"
result = re.match(pattern, s)
print(result.group())
print("第一个分组匹配结果：", result.group(1))
print("第二个分组匹配结果：", result.group(2))

print("-------------------------------")
print('贪婪模式')
s = "abc123"
v = re.match(r'abc(\d+)', 'abc123')
print(v.group(1))
print('非贪婪模式')
v = re.match(r'abc(\d+?)', 'abc123')
print(v.group(1))
